<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title></title>
    <script src="../static/frame/Jstools.js"></script>


    <link rel="stylesheet" href="//cdn.bootcss.com/zui/1.9.1/css/zui.min.css">
    <link href="static/frame/zui-theme.css" rel="stylesheet" />
    <!-- ZUI Javascript 依赖 jQuery -->
    <script src="//cdn.bootcss.com/zui/1.9.1/lib/jquery/jquery.js"></script>
    <!-- ZUI 标准版压缩后的 JavaScript 文件 -->
    <script src="//cdn.bootcss.com/zui/1.9.1/js/zui.min.js"></script>
    <link href="https://cdn.bootcss.com/zui/1.8.1/lib/tabs/zui.tabs.min.css" rel="stylesheet">
    <script src="https://cdn.bootcss.com/zui/1.8.1/lib/tabs/zui.tabs.min.js"></script>
    <style>
            html, body {
                height: 100%;
                margin: 0;
                padding: 0;
            }
        </style>

    <script type="text/javascript">
    function newTab(url, id, t, type) {

        var dd = t.replace(/<\/?.+?>/g, "");
        t = dd.replace(/ /g, "");//dds为得到后的内容
        try {
            id = id.replace(/[ ]/g, "");
        }
        catch (e) {

        }

        t = t.replace(/[ ]/g, "");

        var myTabs = $('#div_view').data('zui.tabs');

        if (!type) {
            var mySpecialTab = myTabs.getTab(id);
            if (mySpecialTab == null || mySpecialTab == undefined) {
                // 要打开的标签页对象
                var myTab = {
                    id: id,
                    url: url,
                    type: 'iframe',
                    title: t
                };
                // 打开标签页
                myTabs.open(myTab, false);
            }
            else {
                myTabs.open(mySpecialTab);
            }
        }
        else {
            try {
                var mySpecialTab = myTabs.getTab("default");
                if (mySpecialTab.url == url) {
                    myTabs.open(mySpecialTab, false);
                }
                else {
                    mySpecialTab.url = url;
                    myTabs.open(mySpecialTab, true);
                }
            }
            catch (e) {

            }
        }
    }

    function onMenueClick(a) {
        if (a != null) {
            url = a.href;
            if (url.indexOf("#") < 0) {
                //frame.src = url;
                newTab(url, a.parentNode.textContent, a.parentNode.innerText, false);
            }
            else {
                u = a.getAttribute("url");
                if (u != null && u != undefined) {
                    //frame.src = url;
                    newTab(u, a.parentNode.textContent, a.parentNode.innerText, false);
                }
                return true;
            }
        }
        return false;
    }
    // 定义标签页
    var tabs = [{
        id: "default",
        title: '首页',
        url: './Document/DefaultPage?DType=1&SearchInfo=&pageSize=10&pageIndex=1',
        type: 'iframe',
        forbidClose: true
    }];


</script>
</head>
<body style="height: 100%;">
<header id="header" class="bg-primary">
  <div class="navbar navbar-inverse navbar-fixed-top" id="navbar" role="banner">
    <div class="container">
      <div class="navbar-header">
          <span  class="navbar-brand">

              <span class="brand-title">蜗牛音乐后台管理</span> &nbsp;
             </span>
      </div>
      <nav class="collapse navbar-collapse zui-navbar-collapse">

      </nav>
    </div>
  </div>

</header>

<div  style="padding-top: 40px;height: 100%;width: 100%;">
    <div style="float: left;height: 100%;border: #cbcbcb solid 1px;overflow-y: auto;">
       <nav class="menu" data-ride="menu" style="width: 250px">
      <ul id="treeMenu" class="tree tree-menu" data-ride="tree">

{#        <li><a href="#"><i class="icon icon-th"></i>首页</a></li>#}
          {% for item in munes %}
            {% if item["parent_id"]=="" %}
                <li><a href=#><i class="icon icon-user"></i>{{ item.name }}</a>
                    {% if item["name"]!="首页" %}
                        <ul>
                        {% for subItem in munes %}
                            {% if subItem["parent_id"]==item["id"] %}
                                <li><a href="{{ subItem.url }}"  onclick="return onMenueClick(this);"><i class="icon icon-user"></i>{{ subItem.name }}</a></li>
                            {% endif %}
                        {% endfor %}
                        </ul>
                    {% endif %}
                </li>
            {% endif %}
          {% endfor %}
       </ul>


    </nav>
    </div>
    <div style="padding-left: 255px;height: 100%;">
        <div class="tabs" id="div_view" style="height:100%;"></div>

    </div>

</div>

<script type="text/javascript">
    $('#div_view').tabs({ tabs: tabs })

    var addModal = null;

        function ShowDilag(url, caption, h, w, o, call, type) {
        options = {
            iframe: url,
            height: h,
            width: w,
            title: caption,
            keyboard:true,
            moveable: true,
            backdrop: 'static' ,
            type: type
        };
        if (addModal != null) {
            $('#triggerModal').on('hidden.zui.modal', function () {
                return ShowDilag(url, caption, h, w, o, call, type);
            });
            addModal.close();
            return false;
        }
        if (o != undefined) {
            window.dialogArguments = o;
        }
        if (type == undefined || type == null) {
            type = "custom";
        }

        addModal = new $.zui.ModalTrigger(options);
        window.dilag = addModal;
        addModal.show({
            onHide: function () {
                if (call != null && call != undefined) {
                    call();
                }
                addModal = null;
            }
        });
        return false;
    }
</script>

</body>

</html>